<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="修改采购订单" bodyClass="white-bg" libs=["prism","bootstrapSelect","ueditor"]/>
<div class="wrapper wrapper-content ibox-content">
    <@form.form id="form-purchase-edit"  class="form-horizontal">
    <input name="id" value="${bpmCrmPurchase.id}" type="hidden">
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "销售员" />：                               <i class="fa fa-question-circle-o" title="销售员"></i>
        </label>
        <div class="col-sm-8"><input name="saleUserid" value="${bpmCrmPurchase.saleUserid?default("")}" class="form-control" type="text"  required>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "销售订单编号" />：                               <i class="fa fa-question-circle-o" title="销售订单编号"></i>
        </label>
        <div class="col-sm-8"><input name="saleOrderNumber" value="${bpmCrmPurchase.saleOrderNumber?default("")}" class="form-control" type="text"  required>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "合同价格" />：                               <i class="fa fa-question-circle-o" title="合同价格"></i>
        </label>
        <div class="col-sm-8"><input name="orderContractPrice" value="${bpmCrmPurchase.orderContractPrice?default("")}" class="form-control" type="text"  required>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "是否含税"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="orderIsTax" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.orderIsTax?default('')}" />
        </div>

    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "是否包含运输费用"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="orderIsTransport" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.orderIsTransport?default('')}" />
        </div>

    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "是否保修"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="orderIsGuarantee" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.orderIsGuarantee?default('')}" />
        </div>

    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "其他" />：                               <i class="fa fa-question-circle-o" title="其他"></i>
        </label>
        <div class="col-sm-8"><input name="orderOtherItem" value="${bpmCrmPurchase.orderOtherItem?default("")}" class="form-control" type="text"  required>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "车辆识别号" />：                               <i class="fa fa-question-circle-o" title="车辆识别号(效验17位)"></i>
        </label>
        <div class="col-sm-8"><input name="carVin" value="${bpmCrmPurchase.carVin?default("")}" class="form-control" type="text"  required>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "车辆" />：                               <i class="fa fa-question-circle-o" title="车辆"></i>
        </label>
        <div class="col-sm-8"><input name="carVehicle" value="${bpmCrmPurchase.carVehicle?default("")}" class="form-control" type="text"  required>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "里程" />：                               <i class="fa fa-question-circle-o" title="里程"></i>
        </label>
        <div class="col-sm-8"><input name="carMileage" value="${bpmCrmPurchase.carMileage?default("")}" class="form-control" type="text"  required>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "变速箱 "/>：</label>
        <div class="col-sm-8">
            <@form.radio name="carTranmission" dictType="sys_crm_cartranmission" value="${bpmCrmPurchase.carTranmission?default('')}" />
        </div>

    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "驱动形式"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="carDrivertrain" dictType="sys_crm_cardrivertrain" value="${bpmCrmPurchase.carDrivertrain?default('')}" />
        </div>

    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "车况"/>：</label>
        <div class="col-sm-8">
            <@form.select name="carStatus" dictType="sys_crm_carstatus" value="${bpmCrmPurchase.carStatus?default('')}"   required="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "最高价" />：                               <i class="fa fa-question-circle-o" title="最高价"></i>
        </label>
        <div class="col-sm-8"><input name="channelHighestPrice" value="${bpmCrmPurchase.channelHighestPrice?default("")}" class="form-control" type="text"  required>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "采购来源"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="channelPurchaseSource" dictType="sys_crm_purchasesource" value="${bpmCrmPurchase.channelPurchaseSource?default('')}" />
        </div>

    </div>
    <div class="form-group auctionClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "是否公开销售"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="channelIsOpenSale" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.channelIsOpenSale?default('')}" />
        </div>

    </div>
    <div class="form-group auctionClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "拍卖 "/>：</label>
        <div class="col-sm-8">
            <@form.select name="channelAuction" dictType="sys_auction" value="${bpmCrmPurchase.channelAuction?default('')}"   required="true" />
        </div>
    </div>
    <div class="form-group auctionClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "拍卖类型"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="channelAuctionType" dictType="sys_crm_auctiontype" value="${bpmCrmPurchase.channelAuctionType?default('')}" />
        </div>

    </div>
    <div class="form-group auctionClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "拍卖时间类型" />：                               <i class="fa fa-question-circle-o" title="拍卖时间类型  （默认值公式：IF(Auction Type=="Other","",IF(Auction Type=="Inlane Bid","Begin Time","Deadline"))）"></i>
        </label>
        <div class="col-sm-8"><input name="channelAuctionTimeType" value="${bpmCrmPurchase.channelAuctionTimeType?default("")}" class="form-control" type="text"  required>
        </div>
    </div>
    <div class="form-group auctionClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "拍卖时间"/>：</label>
        <div class="col-sm-8">
            <div class="input-group date">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input class="form-control time-input" name="channelAuctionTime"  data-type="date"   value="${(bpmCrmPurchase.channelAuctionTime?string('yyyy-MM-dd'))!}" data-format="yyyy-MM-dd" type="text"  required/>
            </div>
        </div>
    </div>
    <div class="form-group otherClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "卖方名称" />：                               <i class="fa fa-question-circle-o" title="卖方名称"></i>
        </label>
        <div class="col-sm-8"><input name="channelSellerName" value="${bpmCrmPurchase.channelSellerName?default("")}" class="form-control" type="text"  required>
        </div>
    </div>
    <div class="form-group otherClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "卖方联系方式" />：                               <i class="fa fa-question-circle-o" title="卖方联系方式"></i>
        </label>
        <div class="col-sm-8"><input name="channelSellerContactinfo" value="${bpmCrmPurchase.channelSellerContactinfo?default("")}" class="form-control" type="text"  required>
        </div>
    </div>
    <div class="form-group otherClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "采购备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="channelPurchaseMemo" class="form-control" required>${bpmCrmPurchase.channelPurchaseMemo?default("")}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "采购专员" />：                               <i class="fa fa-question-circle-o" title="采购专员"></i>
        </label>
        <div class="col-sm-8"><input name="managerPurchaseSpecialist" value="${bpmCrmPurchase.managerPurchaseSpecialist?default("")}" class="form-control" type="text"  required>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "审查"/>：</label>
        <div class="col-sm-8">
            <#list dict.getType('sys_crm_review')>
            <#assign managerReviewList = bpmCrmPurchase.managerReview?default("")?split(",") />
            <#items as d>
            <#if d.status =='0' >
            <label><input type="checkbox" id="managerReview_${(d.id)?default('')}" name="managerReview"
                          value="${d.dictValue}" <#if managerReviewList?seq_contains(d.dictValue) >checked</#if>>
            <label for="${(d.id)?default('')}" text="${d.dictLabel}">${d.dictLabel}</label></label>
        </#if>
    </#items>
</#list>
<!--  <@form.checkbox name="managerReview" dictType="sys_crm_review" value="${bpmCrmPurchase.managerReview?default('')}" />     -->
</div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "审查备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="managerReviewMemo" class="form-control" required>${bpmCrmPurchase.managerReviewMemo?default("")}</textarea>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "是否采购"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="managerIsPurchase" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.managerIsPurchase?default('')}" />
    </div>

</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "采购结果"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="purchaseResult" dictType="sys_result_status" value="${bpmCrmPurchase.purchaseResult?default('')}" />
    </div>

</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "结果时间"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control time-input" name="purchaseResultTime"  data-type="date"   value="${(bpmCrmPurchase.purchaseResultTime?string('yyyy-MM-dd'))!}" data-format="yyyy-MM-dd" type="text"  required/>
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "结果备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="purchaseResultMemo" class="form-control" required>${bpmCrmPurchase.purchaseResultMemo?default("")}</textarea>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "是否入库"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="isWarehousing" dictType="sys_crm_isOrNo" value="${bpmCrmPurchase.isWarehousing?default('')}" />
    </div>

</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "付款发送日期"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control time-input" name="cashierPaySentTime"  data-type="date"   value="${(bpmCrmPurchase.cashierPaySentTime?string('yyyy-MM-dd'))!}" data-format="yyyy-MM-dd" type="text"  required/>
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "付款方式"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="cashierPayMethod" dictType="sys_crm_paymethod" value="${bpmCrmPurchase.cashierPayMethod?default('')}" />
    </div>

</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "证明" />：                               <i class="fa fa-question-circle-o" title="证明"></i>
    </label>
    <div class="col-sm-8"><input name="cashierProofFilepath" value="${bpmCrmPurchase.cashierProofFilepath?default("")}" class="form-control" type="text"  required>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "收据单号" />：                               <i class="fa fa-question-circle-o" title="收据单号"></i>
    </label>
    <div class="col-sm-8"><input name="cashierReceiptNumber" value="${bpmCrmPurchase.cashierReceiptNumber?default("")}" class="form-control" type="text"  required>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "出纳付款备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="cashierMemo" class="form-control" required>${bpmCrmPurchase.cashierMemo?default("")}</textarea>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "支付结果"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="confirmPayMethod" dictType="sys_result_status" value="${bpmCrmPurchase.confirmPayMethod?default('')}" />
    </div>

</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "金额" />：                               <i class="fa fa-question-circle-o" title="金额"></i>
    </label>
    <div class="col-sm-8"><input name="confirmPayAmount" value="${bpmCrmPurchase.confirmPayAmount?default("")}" class="form-control" type="text"  required>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "确认走账备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="confirmMemo" class="form-control" required>${bpmCrmPurchase.confirmMemo?default("")}</textarea>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "付款总额" />：                               <i class="fa fa-question-circle-o" title="付款总额"></i>
    </label>
    <div class="col-sm-8"><input name="purchasePaySum" value="${bpmCrmPurchase.purchasePaySum?default("")}" class="form-control" type="text"  required>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "采购备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="purchaseRemark" class="form-control" required>${bpmCrmPurchase.purchaseRemark?default("")}</textarea>
    </div>
</div>

</@form.form>
<@footer>
<script type="text/javascript">
    var prefix = baseURL + "bpm/purchase";
    $("#form-purchase-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if (opt.validate.form()) {
            opt.operate.save(prefix + "/edit", $('#form-purchase-edit').serialize());
        }
    }
    /**
     * redio 单选回调
     * @param id
     * @param data
     * @param event
     */
    function  redioCallback(id,data,event){
        if(id == "channelPurchaseSource"){
            if ($(data).is(':checked')){
                var menuType = $(event.target).val();
                if(menuType=="0"){
                    $(".auctionClass").show();
                    $(".otherClass").hide();
                }
                else if(menuType=="1"||menuType=="2"||menuType=="3"){
                    $(".auctionClass").hide();
                    $(".otherClass").show();
                }
            }
        }
    }
</script>
</@footer>
</@pageTheme>
